//2009/08/21 11:25:50
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class FunnyFence
{
public:
    int getLength(string s)
    {
		int mmax = -1;
		int cnt = 1;
		for(int i=1; i<s.size(); i++)
		{
			if(s[i] !=  s[i-1])
			{
				cnt ++;
				cout << s[i] << " ";
			}
			else
			{
				if(cnt > mmax || mmax == -1)
					mmax = cnt;
				cnt = 1;
				cout << endl;
			}
		}
		mmax = max(mmax, cnt);
		return mmax;
    }
};
